
import { _decorator, Component, Node, find } from 'cc';
const { ccclass, property } = _decorator;


 
@ccclass('GameConfig')
export class GameConfig extends Component {

    @property
    gameSize = 19; //棋盘大小，9*9 13*13 19*19 只有这三种大小

    @property
    boardWight = 300; //线与线距离

    width: number = 0;

    public points: number[] = null;

    public myColor: number = 0;

    public pieceColor: number = 0;

    private static _instance: GameConfig;

    static get instance() {
        if (GameConfig._instance == null) {
            this._instance = find("Canvas/FOG_GO_GAME_CONFIG").getComponent(GameConfig);
        }
        if (GameConfig._instance == null) {
            let n: Node = new Node();
            n.name = "FOG_GO_GAME_CONFIG";
            n.parent = find("Canvas");
            GameConfig._instance = n.addComponent(GameConfig);
        }
        GameConfig._instance.width = GameConfig._instance.boardWight / ((GameConfig._instance.gameSize - 1) / 2);

        return this._instance;
    }



    // start () {
    //     // [3]
    // }

    // update (deltaTime: number) {
    //     // [4]
    // }
}
